const orderDao = require('../dao/orderDao.js');

module.exports.findAll = async function(searchObj,page){
    return await orderDao.findAll(searchObj,page);
}

module.exports.findById = async function (_id) {
    return await orderDao.findById(_id);
}

module.exports.insert = async function(order){
    return await orderDao.insert(order);
}

module.exports.update = async function(id,order){
    try{
        return await orderDao.update(id,order);
    }catch(e){
        console.log('e',e)
        return {}
    }
}

module.exports.delete = async function(id){
    try{
        return await orderDao.delete(id);
    }catch(e){
        return {}
    }
}